//package cn.cdu.basics.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.env.Environment;
//import org.springframework.core.env.Profiles;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.PathSelectors;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.service.ApiInfo;
//import springfox.documentation.service.Contact;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
//import io.swagger.v3.oas.annotations.Operation;
//import org.springframework.web.bind.annotation.*;
//import javax.annotation.PostConstruct;
///**
// * Swagger配置类
// */
//@Configuration
//@EnableSwagger2
//public class SwaggerConfig {
//
//    @PostConstruct
//    public void init() {
//        System.out.println("SwaggerConfig initialized");
//    }
//    @Bean
//    public Docket createRestApi(Environment env) {
//        // 设置要显示swagger的环境
//        Profiles of = Profiles.of("dev", "test");
//        boolean b = env.acceptsProfiles(of);
//        System.out.println("Swagger enabled: " + b);
//        return new Docket(DocumentationType.SWAGGER_2)
//                .apiInfo(apiInfo())
//                .enable(true)
//                .select()
////                .apis(RequestHandlerSelectors.basePackage("cn.cdu.basics.config"))
//                .paths(PathSelectors.any())
//                .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
//                .build();
//    }
//
//    private ApiInfo apiInfo() {
//        return new ApiInfoBuilder()
//                .title("智慧医院就诊系统API文档")
//                .description("智慧医院就诊系统后端接口文档")
//                .contact(new Contact("开发团队", "", ""))
//                .version("1.0.0")
//                .build();
//    }
//}